﻿using System;
using System.ComponentModel.Composition;
using System.Net;

namespace FinMkts.Messaging.Pgm
{
    [InheritedExport]
    public abstract class PgmConfiguration
    {
        /// <summary>
        /// IP address of the local network card to bind to (optional)
        /// </summary>
        public string BindInterface { get; set; }

        /// <summary>
        /// The IP address of the multicast group
        /// </summary>
        public IPAddress MulticastAddress { get; set; }
        
        /// <summary>
        /// The port (service number) of the multicast group
        /// </summary>
        public int MulticastPort { get; set; }

        /// <summary>
        /// Transmission rate for the send window, in kilobits per second
        /// </summary>
        public BinarySize RatePerSec { get; set; }

        /// <summary>
        /// Window size for the send window, in typically in milliseconds
        /// </summary>
        public TimeSpan WindowLength { get; set; }

        /// <summary>
        /// Window size for the session, in bytes
        /// </summary>
        public BinarySize WindowSize { get; set; }
     
        /// <summary>
        /// The max size of a single message, in kilo bytes
        /// </summary>
        public BinarySize MaxMessageSize { get; set; }

        /// <summary>
        /// The frequency that sender and receiver statistics are reported
        /// </summary>
        public TimeSpan StatsInterval { get; set; }

        /// <summary>
        /// The number of routers a message can pass through before it dies
        /// </summary>
        /// <remarks>Time-to-live</remarks>
        public int MulticastTTL { get; set; }

        /// <summary>
        /// Is the network connection 100Mb+
        /// </summary>
        public bool HighSpeedIntranet { get; set; }
    }
}